home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 1
/
Cream of the Crop 1.iso
/
EDITOR
/
AMAC44.ARJ
/
FIL001.QM
< prev
next >
Wrap
Text File
|
1992-06-22
|
27KB
|
549 lines
* fil001.qm
* Macros To Delete, Save and Edit Files
* Written By Tom Hogshead
* [ See FILExx.QM For Use ]
* 6/4/92
*
* Key Subfile Description
* ===== ============== ====================================================
* @7 Load File Name at Cursor That is or is Not: ( ) |chg
* - Enclosed with Any Single Characters
* - Followed by Any Single Trailing Character
* @5 Load File Name at Cursor, No Enclosures
* @6 Reload Current File from Disk Copy
* @8 READ Macfile of Txtfile That is Loaded
* @2 READ Macfile & LOAD it's Txtfile From Sorted List
* @f7 READ Macfile & LOAD it's Txtfile From Txtfile List
* @f8 READ Macfile From Macfile List, Txtfile Not Loaded
* @1 LOAD File from Sorted List
* @4 LOAD File from "Picklist", Wild Cards OK
* @3 DELETE File from Sorted List
* @f1 SAVE file with name "Mos_Day_Hour_Min.Ext"
* @f2 SAVE file with name "CurrentFileName.Mos_Day"
* @f3 SAVE Read-Only files
* @f4 DELETE CurrentFileName backup (.bak)
* @f5 LOAD CurrentFileName backup (.bak)
* ^2_ COPY CurrentFileName to Scrap/Scratch Buffers
* Without Changing Edit Status of Current File
* ^6_ GET Currentfilename From Scratch Buffer
* Without Changing Edit Status of Current File
*
* {e:\up\mis004} Macros to compare files
* @f2 {e:\up\BUFF*} Cut CurrentFileName Extension To Scrap
* @f3 {e:\up\BUFF*} Cut CurrentFileName Extension To Scrap,
* Adds Dot If No Extension
*
* {e:\up\FILE*} Return To FILExx.QM
*
*--eoi
* M A C R O S
* ----------------------------------------------------------------------
* @(1) Selects File To Load From Sorted List of Files In Directory
* ----------------------------------------------------------------------
@1 Macrobegin
altwordset * For all file names
EditFile "file.srt" return * Load sort list
pause * Select sort type
copy * Copy line to scrap
quit * Quit file.srt
DOS "file-DX " * Make/sort file list
paste return return
EditFile "c:!" return * Load sorted file list
cursordown insertline
cursordown * Get to first file name line
pause * Pause to select file
begline wordright * Put cursor on file name
markword copy * Mark/copy file name
killfile quit * Kill/quit c:!
EditFile paste return * Load file
defaultwordset * Reset default
*
* 68 bytes Sun 09-09-1990 14:38:25
*
* ----------------------------------------------------------------------
* @(2) LOAD Txtfile/READ Macfile From Sorted List of Files In Directory
* ----------------------------------------------------------------------
@2 Macrobegin
altwordset * For all file names
DOS "file-DX mac d-" * Sort macfiles by date
return return
EditFile "c:!" return * Load sorted file list
cursordown insertline
cursordown * Get to first file name line
pause * Pause to select
begline * Re-position cursor if moved
find "." return return * Select it and get to dot
CursorRight delrtword CursorLeft* Delete extension
markword copy * Mark/copy file name - no ext
killfile quit * Kill/quit c:!
EditFile paste "qm" return * Load txtfile
defaultwordset * Reset default
macroread paste "mac" return * Read macfile
*
* 78 bytes Sun 09-09-1990 14:38:29
*
* ----------------------------------------------------------------------
* @(3) Selects File to DELETE From Sorted List of Files In Directory
* ----------------------------------------------------------------------
* Be careful to select ONLY the file you want deleted.
@3 Macrobegin
altwordset * For all file names
EditFile "file.srt" return * Load sort list
pause * Pause to select sort
markline copy paste * Paste selected line
begline markword * Mark file ext
quit * Quit file.srt
DOS "file-DX " * Make/sort file list
paste return return *
EditFile "c:!" return * Load sorted file list
cursordown insertline *
cursordown * Get to first file name line
pause * Pause to select file
begline wordright * Put cursor on file name
markword copy * Select it
insertline * Insert line in c:!
paste * Paste file name
copy * Copy file name to scrap
DOS "del " paste return return * Delete select file
killfile quit * Kill/quit c:!
defaultwordset * Reset default
*
* 84 bytes Sun 09-09-1990 14:38:34
*
* ----------------------------------------------------------------------
* @(4) Load Files From PickList
* ----------------------------------------------------------------------
* To run, just press Alt and 4 at the same time. At the prompt "File=",
* enter a [file name(s)] and [file sort option] to make a PickList
* using the following syntax:
*
* [file name(s)] [file sort option] <enter>
*
* where [file sort option] is either "esda".
*
* For example, when entering:
*
* c*.* s- (space must be included between name/sort option!)
*
* a file to load can be selected from a PickList of all files in
* the current directory beginning with the letter "c" sorted by size,
* largest first. Entering file name(s) WITHOUT a sort option, makes
* a PickList sorted by name an then extension.
*
* This macro can sort files in any order. The following information is
* from the file DX.DOC for Directory Extender. Please read this
* document for more information on using the excellent program DX.
*
* Sorting is by name by default. The /SOrt switch without a value sorts
* by name and then extension in ascending order. The sorting
* criteria consists of: "N" for name, "E" for extension, "S" for size,
* "D" for date/time, "A" for attribute. Specifying a letter by itself
* or with a '+' suffix indicates ascending order; specifying a '-'
* suffix indicates descending order.
*
* Examples of the sort options are:
*
* [filename(s)] ne => sort by name and extension
*
* [filename(s)] e-n- => sort files descending by
* extension first and then by
* descending name
*
* [filename(s)] snd- => sort files by ascending size,
* ascending name, and then
* descending date
*
@4 Macrobegin
unmarkblock altwordset * For all file names
begline insertline * Insert temp line
"File="
endline markcolumn * Start mark
pause * File name?, wild cards OK
markcolumn copy * Mark/copy file name to scrap
delline * Delete temp line
DOS "PICK " paste * Make PickList
return return
EditFile "c:!" return * Load list
cursordown insertline
cursordown * Get to first file name line
pause * Pause to select file
begline wordright * Put cursor on file name
markword copy * Mark/copy selection to scrap
killfile quit * Kill/quit c:!
EditFile paste return * Load file selected
defaultwordset * Reset default
*
* 60 bytes Sun 09-09-1990 14:38:38
*
* ----------------------------------------------------------------------
* @(5) Load File Name At Cursor
* ----------------------------------------------------------------------
* This macro picks up a file name that is sitting at the cursor
* position in the editor, and loads it into another buffer. It is a
* modification of a macro from SemWare BBS.
@5 macrobegin
altwordset
markword
jfalse END
copy editfile paste return defaultwordset
END:
*
* 11 bytes Sun 09-09-1990 14:38:43 (IN FILExx.QM as @5)
* 14 bytes Thu 01-09-1992 08:28:51 (TH @5, added markword test)
*
* ----------------------------------------------------------------------
* @(6) Reloads Current File From Disk
* ----------------------------------------------------------------------
@6 Macrobegin
SplitLine EditFile CurrentFileName Return NewFile "N" Return
*
* 12 bytes Fri 08-10-1990 15:24:13
*
* ----------------------------------------------------------------------
* @(7) Load File Name At Cursor That Is or Is Not:
* - Enclosed With Any Single Characters
* - Followed By Any Single Trailing Character
* ----------------------------------------------------------------------
* This macro loads file name at cursor that is or is not enclosed with
* any single characters or followed by any single trailing character,
* excluding a colon:
* a - Names enclosed with characters or followed by any single
* trailing character must have d:\path\ in name but need not
* contain an extension.
* b - Names followed by any single trailing character can NOT be
* enclosed with characters.
* c - Names not enclosed with characters need not have d:\path\ in
* name.
* d - Wild cards '* and ?' cannot be used.
* e - Use @5 if file names are NOT enclosed with characters.
* f - Qedit v2.15 is required.
* With Qconfig set to load extension '.qm' without specifying the
* extension, the following are valid and invalid forms to load this
* file or the nul file:
* Valid Invalid
* -------------- -------------
* (e:\up\fil001.qm)
* (e:\up\fil001) (fil001)
* e:\up\fil001
* e:\up\fil001.qm
* fil001
* fil001.qm (fil001.qm)
* Load nul file ...
* (e:\up\nul)
* (e:\up\nul.)
* e:\up\nul
* e:\up\nul.
* nul (nul)
* nul. (nul.)
@7 macrobegin
setscreenoff
altwordset * For all file names
markword jfalse END * Mark name to test
editfile 'nul' return quit *|
gotoblockbeg *|
copy * Copy name in case no enclosure
editfile return * Load nul *|
paste * Paste name to nul *|
dupline * Duplicate name on line below *|
gotoblockbeg * Pos to test if enclosed
find ":" return "L" return * Pos on first ':'
jfalse DEL * If no ':' assume no enclosure
cursorleft splitline cursorleft * Move to first drive letter
isendline jtrue DEL * Test true if enclosed *|
joinline delch * Remove lft enclosure
gotoblockend backspace * Remove rt enclosure
copy * Reposition and copy name
DEL: *|
quit * Quit Nul *|
editfile paste return * Load non-enclosed name
jtrue END * Test if load error
escape escape * Remove error window
editfile * Begin loading
endline backspace * Remove trailing char
return * Finish loading
END:
defaultwordset * Reset
*
* 11 bytes Sun 09-09-1990 14:38:43 (IN FILExx.QM as @5)
* 14 bytes Thu 01-09-1992 08:28:51 (TH @5, added markword test)
* 55 bytes Fri 05-15-1992 11:48:17 (TH @7)
* 62 bytes Thu 06-04-1992 10:15:44 (TH @7, use nul to not chg edit stat *|)
*
* ----------------------------------------------------------------------
* @(8) Reads Macfile Of Txtfile That Is Loaded
* ----------------------------------------------------------------------
* From MACRxx.QM
@8 Macrobegin
macroread CurrentFileName backspace backspace "mac" return
*
* 15 bytes Sun 09-09-1990 14:38:55
*
* ----------------------------------------------------------------------
* @(f1) Saves File With Name "Mos_Day_Hour_Min.Ext"
* ----------------------------------------------------------------------
* This macro saves the current file with the name as
* "Mos_Day_Hour_Min.Ext". For example, @f1 saves this file as
* 08191025.QM when date and time are Sun 08-19-1990 10:25:00.
* Insert must be ON.
* Thanks to Jim Wright for the neat idea how to condense date and time
* with his macro in QE-MEM.ZIP. Like many other macro ideas from
* others, they often seem so simple once we see and understand them
* that we say "why didn't I think of that" - but I didn't !
@f1 Macrobegin
*************************************** TOGGLE INSERT ON*************
insertline * Insert test line
"a" CursorLeft "a" * Insert "aa"
endline * If not at endline-insert is on
Jtrue FIN * If at endline -insert is off
toggleinsert * Toggle ON if off
FIN: *
delline * Delete test line
*************************************** CONDENSE DATE & TIME *******
unmarkblock * Begin no marked block
insertline begline * Insert line
insertdate inserttime * Get date & time to condense
markline
delltword delltword * Delete seconds
backspace * Delete :
CursorLeft CursorLeft * Keep minutes
backspace * Delete :
CursorLeft CursorLeft * Keep hour
delltword delltword * Delete spaces and year
backspace * Delete -
CursorLeft CursorLeft * Keep day
backspace * Delete -
CursorLeft CursorLeft * Keep month
delltword delltword * Delete spaces & day name
endline * Go to end of condensed number
CurrentFileName * Get CurrentFileName
find "." return "LB" return * Move to begin of extension
jtrue HASEXT * If dot found, file has extn.
* and go to HASEXT
*ELSE
Endline "." CursorLeft * Add ".", file has NO extn.
HASEXT: *
unmarkblock * unmark line
CursorLeft markcolumn * Move off dot and mark it
find ":" return "b" return * Move to :
CursorLeft deleteblock * Del all but .ext of file name
cut * Get number.ext to scrap
writeblock paste return * Save number.ext
*
* 74 bytes Wed 02-13-1991 23:16:45
*
* ----------------------------------------------------------------------
* @(f2) Saves File With Name "CurrentFileName.Mos_Day"
* ----------------------------------------------------------------------
* Macro saves the current file with name "CurrentFileName.Mos_Day".
* For example, @f2 saves it as FILE28.214 when date and time are
* Thu 02-14-1991 10:25:00. Use this macro Jan-Sept.
@f2 Macrobegin
unmarkblock * Begin no marked block
insertline begline * Insert line
insertdate * Get date & time to condense
delltword delltword * Delete spaces and year
backspace * Delete -
CursorLeft CursorLeft * Keep day
backspace * Delete -
CursorLeft * Keep last digit of month,
backspace * Delete first digit of month
backspace * Delete -
delltword delltword * Delete spaces & day name
begline
CurrentFileName * Get CurrentFileName
delltword * Delete extension
cut * Get file name.num to scrap
writeblock paste return * Save file name.num
*
* 26 bytes Wed 10-03-1990 19:24:02
* * Macro saves the current file with name "CurrentFileName.Mos_Day".
* * For example, @f2 saves it as FILE28.119 when date and time are
* * Sun 10-19-1990 10:25:00. Use this macro Oct-Dec.
* *
* @f2 Macrobegin
* unmarkblock * Begin no marked block
* insertline begline * Insert line
* insertdate * Get date & time to condense
* delltword delltword * Delete spaces and year
* backspace * Delete -
* CursorLeft CursorLeft * Keep day
* backspace * Delete -
* backspace * Delete last digit of month
* CursorLeft * Keep first digit of month,
* delltword delltword * Delete spaces & day name
* begline *
* CurrentFileName * Get CurrentFileName
* delltword * Delete extension
* cut * Get file name.num to scrap
* writeblock paste return * Save file name.num
*
* 25 bytes Fri 10-19-1990 12:53:19
*
* ----------------------------------------------------------------------
* @(f3) Saves Read Only Files
* ----------------------------------------------------------------------
* This macro will save the currently loaded file if the file attribute
* on the disk copy is set to Read Only. QEdit currently will not save
* files loaded as Read-Only. Requires Dos ATTRIB.EXE.
@f3 Macrobegin
setscreenoff * For less flashing
insertline * Insert temporary line
unmarkblock markcolumn currentfilename * Insert file name
editfile "nul" return quit * Insure "nul" not loaded
gotoblockbeg cut * Cut filename to scrap
changefilename return * Change file name to "nul"
dos "ATTRIB -R " paste return return * Clear Read Only attribute
changefilename paste return "y" * Change to original file name
delline * Delete temporary line
setscreenon * To see savefile
savefile * Save original file
*
* 80 bytes Wed 02-13-1991 16:14:00
* 54 bytes Fri 04-24-1992 09:02:20 (TH @f3, shortened)
*
*--------------------------------------
* #(f4) Deletes CurrentFileName Backup
*--------------------------------------
@f4 Macrobegin
Unmarkblock Insertline Begline * Insert temp line with
Dropanchor CurrentFileName * CurrentFileName marked
Find "." Return "LB" Return * Find dot backwards
DelToEol ".bak" * Add .bak
Cut * Cut name.bak to scrap
DOS "DEL " Paste Return Return * Delete name.bak
* DOS "DX " Paste "//DEL" * Alternate verify delete
* Return Return * with Directory Extender DX
*
* 40 bytes Sun 02-17-1991 14:10:19
* 40 bytes Tue 05-26-1992 09:57:38 (TH @f4, changed key from #f7)
*
*----------------------------------
* @(f5) Load CurrentFileName Backup
*----------------------------------
@f5 Macrobegin
Unmarkblock Insertline Begline * Insert temp line with
Dropanchor CurrentFileName * CurrentFileName marked
Find "." Return "LB" Return * Find dot backwards
DelToEol ".bak" * Add .bak
Cut * Cut name.bak to scrap
EditFile Paste Return * Load name.bak
*
* 31 bytes Sun 02-17-1991 14:10:06
* 31 bytes Tue 05-26-1992 09:56:59 (TH @f5, changed key from #f8)
*
* ----------------------------------------------------------------------
* @(f7) READ macfile & LOAD it's txtfile from txtfile list
* ----------------------------------------------------------------------
* @f7 enables a file to be selected for editing and it's macfile read
* from a prepared list of txtfiles. The list of txtfiles (-qm.lst)
* included with FILE28 is a list of the latest macros in this series,
* but it can be altered to meet your needs by adding [drive:]\[path\]
* both in front of each file in the list and also in the second line of
* the macro, and adding or deleting any files you choose to/from this
* list. The modified macro can be put in your QCONFIG.DAT file and
* macros can be loaded and read while in any directory. To run, press
* @f7, cursor down to the desired file, and press <enter>. Remember,
* txtfiles must have the extension "QM" and the macfiles must have the
* extension "MAC".
@f7 Macrobegin
EditFile "-qm.lst" return * Edit txtfile list
pause * Pause to select macro to read
endline * Go to end of file name
backspace backspace * and remove it's extension
copy quit * Copy file name to scrap
EditFile paste "qm" return * Load selected macro txtfile
macroread paste "mac" return * and read it's macfile
*
* 42 bytes Thu 10-18-1990 12:23:41
*
* ----------------------------------------------------------------------
* @(f8) READ macfile from macfile list, txtfile not loaded
* ----------------------------------------------------------------------
* @f8 enables a macfile to be selected and read from a prepared list
* of macfiles. The list of macfiles (-mac.lst) included with FILE28 is
* a list of the latest macros in this series, but it can be altered to
* meet your needs by adding [drive:]\[path\] in front of each file in
* the list and also in the second line of the macro, and adding or
* deleting any files you choose to/from this list. The modified macro
* can be put in your QCONFIG.DAT file and macros can be read while in
* any directory. To run, press @f8, cursor down to the desired file,
* and press <enter>. Remember, macfiles must have the extension "MAC".
@f8 Macrobegin
EditFile "-mac.lst" return * Edit macfile list
pause * Pause to select macro to read
endline * Go to end of macfile name
backspace backspace backspace * and remove it's extension
copy quit * Copy macro name to scrap
macroread paste "mac" return * Read it's macfile only
*
* 38 bytes Thu 10-18-1990 12:23:50
*
* ----------------------------------------------------------------------
* ^(2_) Copy CurrentFileName to Scrap and Scratch Buffers
* Without Changing Edit Status of Current File
* ----------------------------------------------------------------------
* An example using this technique can be seen in @f bok001.qm.
^2 macrobegin
findreplace #254 return * Initialize FindReplace
currentfilename return escape * w/starting currentfilename
editfile "NUL" return dropanchor #254 * Insert dummy char in NUL
findreplace return return "BN" return * Replace char w/file name
storescrbuff "n" return * Store file name to buff "n"
copy quit * Copy file name, quit nul
* (do in multiple files)
editfile paste return * Return to starting file
*
*
* 39 bytes Sat 10-26-1991 15:17:20 (TH ^2)
*
* ----------------------------------------------------------------------
* ^(6_) Get CurrentFileName from Scratch Buffer
* Without Changing Edit Status of Current File
* ----------------------------------------------------------------------
* Run ^2 first. An example using this technique can be seen in @f
* bok001.qm.
^6 macrobegin
editfile "nul" return
getscrbuff "n" return * Get file name from buff "n"
copy quit * Copy file name, quit nul
editfile paste return * Load starting file
*
* 21 bytes Sat 10-26-1991 15:17:07 (TH ^6)